package cn.tedu.system.base.exception;

import cn.tedu.system.base.response.StatusCode;
import lombok.Getter;

/**
 * 自定义的业务层异常
 */
public class ServiceException extends RuntimeException {
    @Getter
    private StatusCode statusCode;

    public ServiceException(StatusCode statusCode) {
        this.statusCode = statusCode;
    }

    public ServiceException(String message) {
        super(message);
        this.statusCode = StatusCode.FAILED;
    }
    public ServiceException(StatusCode statusCode, String message) {
        super(message);
        this.statusCode = statusCode;
    }
}
